package exc;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;

public class FirstTest {
	public static void main(String[] args) {
		WebDriver driver = new FirefoxDriver();

		driver.get("http://www.baidu.com");

		WebElement webEle = driver.findElement(By.id("kw"));

		webEle.sendKeys("56 微博江湖");
		webEle.submit();

		System.out.print("1title: " + driver.getTitle());

		driver.get("http://www.baidu.com");

		webEle = driver.findElement(By.name("tj_baike"));

		webEle.click();

		// String s1 = driver.getCurrentUrl();
		// System.out.println("==================================s1===================================="
		// + s1);
		//
		// String s2 = driver.getPageSource();
		// System.out.println("==================================s2===================================="
		// + s2);
		driver.quit();
	}
}
